#!/usr/bin/env python

import sys
import os
import pprint
import re
from optparse import OptionParser


regexpsToReplace = [
    ('Password="[A-Za-z0-9/+=]{196}"',
     'Password="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAIuG4NBZ5gkaPbHYNXkCFDQQAAAACAAAAAAADZgAAqAAAABAAAADgjrqUlwzgMwTYSgFCFNkVAAAAAASAAACgAAAAEAAAAJRatB+4oVdF53oprWG3seQIAAAAXAHmix8D9x4UAAAA9E6A1TnAKQ7uOMssNcaPc29EK9g="'),
    (r'BLDWTL[0-9][0-9]\.aqua\.mitra\.com', r'bconrad.aqua.mitra.com'),
    (r'E:\\sandbox', r'D:\sandbox'),
    ]

global options

def output(s):
    if options.noisy:
        print s

def main(args=None):

    if args == None:
        args = sys.argv[1:]

    w = file('web.config', 'rb')
    wInnards = w.read()
    w.close()
    
    for ( old, new ) in regexpsToReplace:
        wInnards = re.sub(old, new, wInnards)

    w = file('web.config', 'wb')
    w.write(wInnards)
    w.close()
    
    return 0


if __name__ == '__main__':
    sys.exit(main())

